<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href=@{'/public/stylesheets/css/style.css'} rel="stylesheet" type="text/css" />
<title>Donuts Mania</title>
</head>
<body>
   <a href= @{Application.inicial()}>Principal</a>
   <a href="@{Administracao.inicial_Administracao()}">Administracao</a>
   <div  style="width:990px;">
     <table style="width:990px" border="1" >
       <tr>
         <th>Sabor</th> <th>Preco</th><th>Data cadastro</th><th>Cadastrado por</th>
       </tr>
       %{int cor=1;}%
       #{list items:donuts, as: 'donut'}
        <tr #{if cor==1} bgcolor="#E0FFFF"#{/if}>
         <td><a href=@{Administracao.alteracao_donut(donut.getNome())}>${donut.getNome()}</a></td> 
         <td>${String.format("R\$ %.2f",donut.getPreco())}</td>
         %{ GregorianCalendar d = donut.getDataCadastro();
            String data =String.format("%d/%d/%d",d.get(Calendar.DAY_OF_MONTH),d.get(Calendar.MONTH),d.get(Calendar.YEAR));
         %}
         <td>${data}</td>
         <td>${donut.getCadastradoPor()}</td>
  
        </tr>
        %{cor = (cor+1) %2;}%
       #{/list}
       
         
            
          
     </table>
   
   
   </div>
    

</body>
</html>